/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "observation_summary")
@NamedQueries({
    @NamedQuery(name = "ObservationSummary.findAll", query = "SELECT o FROM ObservationSummary o")})
public class ObservationSummary implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "observation_summary_id")
    private Integer observationSummaryId;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "observation_id")
    private Observation observation;
    
    @Column(name = "summary")
    private String summary;
    
    @Embedded
    private InfoAudit infoAudit;

    public ObservationSummary() {
    }

    public ObservationSummary(Integer observationSummaryId) {
        this.observationSummaryId = observationSummaryId;
    }

    public Integer getObservationSummaryId() {
        return observationSummaryId;
    }

    public void setObservationSummaryId(Integer observationSummaryId) {
        this.observationSummaryId = observationSummaryId;
    }

    public Observation getObservation() {
        return observation;
    }

    public void setObservation(Observation observation) {
        this.observation = observation;
    }

   
    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (observationSummaryId != null ? observationSummaryId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ObservationSummary)) {
            return false;
        }
        ObservationSummary other = (ObservationSummary) object;
        if ((this.observationSummaryId == null && other.observationSummaryId != null) || (this.observationSummaryId != null && !this.observationSummaryId.equals(other.observationSummaryId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.ObservationSummary[ observationSummaryId=" + observationSummaryId + " ]";
    }
    
}
